﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MealBooking.Core.Models.Dishes;
using MealBooking.Core.Services.Interface.MealService;
using Microsoft.Practices.ServiceLocation;
using MealBooking.Core.Services.Interface.DishService;
using MealBooking.Core.Models.Meals;

namespace MealBooking.Core
{
    public static partial class CoreService
    {
        public static class DishService
        {
            #region private
            private static IDishService GetInstance()
            {
                return ServiceLocator.Current.GetInstance<IDishService>();
            }
            #endregion

            #region Dish
            public static List<Dish> AllDishes()
            {
                return GetInstance().AllDishes();
            }
            public static List<Dish> DishesWithoutDishCategory()
            {
                return GetInstance().DishesWithoutDishCategory();
            }
            public static Dish DishDetail(string dishId)
            {
                return GetInstance().DishDetail(dishId);
            }
            public static List<Dish> DishDetails(List<string> dishIds)
            {
                return GetInstance().DishDetails(dishIds);
            }
            public static Dish IsDishNameInUse(string dishName)
            {
                return GetInstance().IsDishNameInUse(dishName);
            }
            public static Dish AddNewDish(Dish newDish)
            {
                return GetInstance().AddDish(newDish);
            }
            public static Dish UpdateDish(Dish newDish)
            {
                return GetInstance().UpdateDish(newDish);
            }
            #endregion

            #region Dishes in Dish Category
            public static List<Dish> DishesInDishCategory(string dishCategoryId)
            {
                return GetInstance().DishesInDishCategory(dishCategoryId);
            }
            public static void UpdateDishesInDishCategory(DishCategory dishCategory)
            {
                GetInstance().UpdateDishesInDishCategory(dishCategory);
            }
            #endregion

            #region Dishes in Meal Category
            public static Dictionary<DishCategory, List<Dish>> DishesInMealCategory(string mealCategoryId)
            {
                return GetInstance().DishesInMealCategory(mealCategoryId);
            }
            #endregion

            #region DishCategory
            public static List<DishCategory> AllDishCategories()
            {
                return GetInstance().AllDishCategories();
            }
            public static DishCategory DishCategoryDetail(string dishCategoryId)
            {
                return GetInstance().DishCategoryDetail(dishCategoryId);
            }
            public static List<DishCategory> DishCategoryDetails(List<string> dishCategoryIds)
            {
                return GetInstance().DishCategoryDetails(dishCategoryIds);
            }
            public static DishCategory IsDishCategoryNameInUse(string newDishCategoryName)
            {
                return GetInstance().IsDishCategoryNameInUse(newDishCategoryName);
            }
            public static DishCategory AddDishCategory(DishCategory newDishCategory)
            {
                return GetInstance().AddDishCategory(newDishCategory);
            }
            public static DishCategory UpdateDishCategory(DishCategory dishCategory)
            {
                return GetInstance().UpdateDishCategory(dishCategory);
            }
            #endregion

            #region DishCategories in MealCategory
            public static List<DishCategory> DishCategoriesInMealCategory(string mealCategoryId)
            {
                return GetInstance().DishCategoriesInMealCategory(mealCategoryId);
            }
            public static void UpdateDishCategoriesInMealCategory(MealCategory mealCategory)
            {
                GetInstance().UpdateDishCategoriesInMealCategory(mealCategory);
            }
            #endregion
        }
    }
}
